package cn.ncu.wechat.controller;

import cn.ncu.wechat.model.ProductCategory;
import cn.ncu.wechat.service.ProductCategoryService;
import cn.ncu.wechat.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/api/admin/product-categories")
public class ProductCategoryController {
    @Autowired
    private ProductCategoryService productCategoryService;

    @GetMapping("")
    public Result<?> getProductCategories(){
        return productCategoryService.getProductCategories();
    }

    @PostMapping ("")
    public Result<?> updateAddProductCategories(@RequestBody Map<String, Object> request){
        return productCategoryService.updateAddProductCategories(request);
    }
}
